package com.sea.finance.service.impl;

import com.codecrane.core.power.entity.DictDetail;
import com.codecrane.core.power.service.DictDetailService;
import com.codecrane.core.web.BatchImportUtils;
import com.sea.finance.entity.Fund;
import com.sea.finance.entity.FundType;
import com.sea.finance.mapper.FundMapper;
import com.sea.finance.mapper.FundTypeMapper;
import com.sea.finance.service.FundService;
import com.sea.finance.service.FundTypeService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.InputStream;
import java.util.List;


/**
 * @author 陈鸿飞
 */
@Service
public class FundTypeServiceImpl implements FundTypeService {
    @Autowired
    private FundTypeMapper fundTypeMapper;
    @Autowired
    private DictDetailService dictDetailService;


    @Override
    public List<FundType> findByCnd(FundType fundType) {
        return fundTypeMapper.findByCnd(fundType);
    }

    @Override
    public int save(FundType fundType) {
        if(StringUtils.isNotBlank(fundType.getFundShopName())) {
            return fundTypeMapper.insert(fundType);
        }else {
            return 0;
        }
    }

    @Override
    public FundType findByShop(FundType fundType) {
        return fundTypeMapper.findByShop(fundType);
    }

    @Override
    public Integer updateTotal(FundType fundType) {
        return fundTypeMapper.updateTotal(fundType);
    }

    @Override
    public List<FundType> findByAllShop() {
        return fundTypeMapper.findByAllShop();
    }

    @Override
    public List<FundType> findByMoneyType(String fundShop) {
        return fundTypeMapper.findByMoneyType(fundShop);
    }

    @Override
    public List<FundType> findByShopMoneyType(FundType fundType) {
        return fundTypeMapper.findByShopMoneyType(fundType);
    }

}
